﻿<?php

$s = ShirtQuery::create()->findPk($_GET['id']);

$d = DisponibiliteQuery::create()->filterByShirtId($_GET['id'])->filterByCouleur($_GET['color'])->filterBySexe($_GET['sex'])->filterByTaille($_GET['size'])->findOne();
$stock = 0;
if($d != null)
	$stock = $d->getQuantite();

//Element a recuperer de la base de donnees
$smarty->assign("shirt", array(
    "id" => $_GET['id'],
    "title" => $s->getNom(),
	"description" => $s->getDescription(),
    "price" => $s->getPrix(),
    "ref" => $s->getId(),
    "brand" => $s->getMarque(),
    "material" => "Coton",
    "dispo" => $stock,
    "color" => $_GET['color'],
    "sex" => $_GET['sex'],
    "size" => $_GET['size'],
    "quantity" => $_GET['quantity'],
));
$smarty->display('info.tpl');